<template>
  <div v-show='isStudentLableStatus'>
    <a-card title='学生基本信息'>
      <j-form-container :disabled="formDisabled" style='cursor: text;'>
        <a-form-model ref='form' :model='model' slot='detail'>
          <a-row>
            <a-col :span='6'>
              <a-form-model-item label='年   级' prop='gradeId'>
                <j-dict-select-tag  class='selected' style='width: 150px;' type='list' v-model='model.gradeId'
                                   dictCode='cou_grade,grade_name,id'
                                    />
              </a-form-model-item>
            </a-col>

            <a-col :span='6'>
              <a-form-model-item label='班   级' prop='classId'>
                <j-dict-select-tag class='selected' style='width: 150px;' type='list' v-model='model.classId'
                                   :dictCode='vDict'
                                   />
              </a-form-model-item>
            </a-col>

            <a-col :span='6'>
              <a-form-model-item label='学生学号' prop='studentNo'>
                <a-input style='' v-model='model.studentNo' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='学生姓名' prop='studentName'>
                <a-input style='' v-model='model.studentName' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='身份证号' prop='studentIdCardNo'>
                <a-input style='' v-model='model.studentIdCardNo' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='卡号' prop='studentCardNo'>
                <a-input style='' v-model='model.studentCardNo' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='学生性别' prop='studentGender'>
                <!--              <a-input style=''-number v-model="model.studentGender" placeholder="请输入学生性别" style="width: 100%" />-->
                <j-dict-select-tag class='selected' type='list' style='width: 150px;' v-model='model.studentGender' dictCode='sex'
                                   />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='出生年月' prop='studentDateBirth'>
                <j-date  v-model='model.studentDateBirth' style='width: 100%' />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='民族' prop='studentNation'>
                <!--              <a-input style=''-number v-model="model.studentNation" placeholder="请输入民族" style="width: 100%" />-->
                <j-dict-select-tag class='selected' type='list' style='width: 150px;' v-model='model.studentNation'
                                   dictCode='common_nation'
                                    />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='联系电话' prop='studentTelephone'>
                <a-input style='' v-model='model.studentTelephone' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='入学年份' prop='studentEnrollmentYear'>
                <a-input style='' v-model='model.studentEnrollmentYear' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='学生微信' prop='studentWechat'>
                <a-input style='' v-model='model.studentWechat' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='学生邮箱' prop='studentEmail'>
                <a-input style='' v-model='model.studentEmail' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='学生QQ' prop='studentQq'>
                <a-input style='' v-model='model.studentQq' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='身高' prop='studentHeight'>
                <a-input  v-model='model.studentHeight'  style='width: 100%;' />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='体重' prop='studentWeight'>
                <a-input  v-model='model.studentWeight'  style='width: 100%;' />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='视力' prop='studentVision'>
                <a-input  v-model='model.studentVision' style='width: 100%;' />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='来源学校' prop='studentFromSchool'>
                <a-input style='' v-model='model.studentFromSchool'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='毕业去向'
                                 prop='studentGraduationDestination'>
                <a-input style='' v-model='model.studentGraduationDestination' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='户籍地址'
                                 prop='studentHouseholdRegister'>
                <a-input style='' v-model='model.studentHouseholdRegister' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='生源地' prop='studentPlaceOrigin'>
                <a-input style='' v-model='model.studentPlaceOrigin'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='现住地址' prop='studentCurrentAddress'>
                <a-input style='' v-model='model.studentCurrentAddress' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='学生类型' prop='studentTtype'>
                <!--              <a-input style=''-number v-model="model.studentTtype" placeholder="请输入学生类型" style="width: 100%" />-->
                <j-dict-select-tag class='selected' type='list' style='width: 150px;' v-model='model.studentTtype'
                                   dictCode='student_ttype'
                                    />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='家庭状态' prop='studentFamilyStatus'>
                <!--              <a-input style=''-number v-model="model.studentFamilyStatus" placeholder="请输入家庭状态" style="width: 100%" />-->
                <j-dict-select-tag class='selected' type='list' style='width: 150px;' v-model='model.studentFamilyStatus'
                                   dictCode='student_family_status' />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='是否贫困生' prop='studentPoor'>
                <!--              <a-input style=''-number v-model="model.studentPoor" placeholder="请输入是否贫困生" style="width: 100%" />-->
                <j-dict-select-tag class='selected' type='list' style='width: 150px;' v-model='model.studentPoor' dictCode='student_poor'
                                    />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='贫困级别' prop='studentPoorLevel'>
                <!--              <a-input style=''-number v-model="model.studentPoorLevel" placeholder="请输入贫困级别" style="width: 100%" />-->
                <j-dict-select-tag class='selected' type='list' style='width: 150px;' v-model='model.studentPoorLevel'
                                   dictCode='student_poor_level'
                                   />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='是否借读生' prop='studentLoan'>
                <!--              <a-input style=''-number v-model="model.studentLoan" placeholder="请输入是否借读生" style="width: 100%" />-->
                <j-dict-select-tag class='selected' type='list' style='width: 150px;' v-model='model.studentLoan' dictCode='student_load'
                                   />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='特殊标识' prop='studentSpecialFlag'>
                <a-input  v-model='model.studentSpecialFlag' style='width: 100%;' />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='紧急联系人'
                                 prop='studentEmergencyContact'>
                <a-input style='' v-model='model.studentEmergencyContact' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='紧急人联系电话'
                                 prop='studentEmergencyTelephone'>
                <a-input style='' v-model='model.studentEmergencyTelephone' ></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='学生状态' prop='studentStatus'>
                <!--              <a-input style=''-number v-model="model.studentStatus" placeholder="请选择学生状态" style="width: 100%" />-->
                <j-dict-select-tag class='selected' type='list' style='width: 150px;' v-model='model.studentStatus'
                                   dictCode='student_status'
                                   />
              </a-form-model-item>
            </a-col>

            <a-col :span='6'>
              <a-form-model-item label='排序号' prop='studentOrder'>
                <a-input  v-model='model.studentOrder' style='width: 100%;' />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='备注' prop='studentRemark'>
                <a-input  v-model='model.studentRemark' style='width: 300px;'></a-input>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-form-model>
      </j-form-container>
    </a-card>
    <a-card
      style='width: 100%'
      title='扩展信息'
      :tab-list='tabList'
      :active-tab-key='key'
      @tabChange="key => onTabChange(key, 'key')"
    >
      <RelClassStudentListComp :studentsId='studentsId' :isRelClassStudentShow='isRelClassStudentShow'></RelClassStudentListComp>
      <AchStudentExaminationScoreListComp :studentsId='studentsId' :isAchStudentExaminationScoreListShow='isAchStudentExaminationScoreListShow'></AchStudentExaminationScoreListComp>
      <AchStudentSubjectScoreListComp :studentsId='studentsId' :isAchStudentSubjectScoreListCompShow='isAchStudentSubjectScoreListCompShow'></AchStudentSubjectScoreListComp>
      <AchStudentSubjProjItemScoreListComp :studentsId='studentsId' :isAchStudentSubjProjItemScoreListCompShow='isAchStudentSubjProjItemScoreListCompShow'></AchStudentSubjProjItemScoreListComp>
    </a-card>
  </div>
</template>

<script>
import RelClassStudentListComp from '../relation/rel_class_student/RelClassStudentListComp'
import AchStudentExaminationScoreListComp
  from '@views/analysis/analysisachievement/achstudent/AchStudentExaminationScoreListComp'
import AchStudentSubjectScoreListComp
  from '@views/analysis/analysisachievement/achstudent/AchStudentSubjectScoreListComp'
import AchStudentSubjProjItemScoreListComp
  from '@views/analysis/analysisachievement/achstudent/AchStudentSubjProjItemScoreListComp'

export default {
  name: 'StuStudentLable',
  components: { RelClassStudentListComp,AchStudentExaminationScoreListComp,AchStudentSubjectScoreListComp,AchStudentSubjProjItemScoreListComp },
  props: {
    isStudentLableStatus: {
      type: Boolean,
      default: false,
      required: false
    },
    studentVo:{
      type: Object,
      default: {}
    }
  },
  data() {
    return {
      disableMixinCreated : true, //默认初始状态不加载数据
      vDict: 'cou_class,class_name,id',
      model: {},
      formDisabled: true,
      tabList: [
        {
          key: 'classId',
          tab: '班级信息'
        },
        {
          key: 'AchStudentExaminationScoreId',
          tab: '考试总成绩'
        },
        {
          key: 'AchStudentSubjectScoreId',
          tab: '考试科目成绩'
        },
        {
          key: 'AchStudentSubjProjItemScoreId',
          tab: '考试各科题型成绩'
        }
      ],
      isRelClassStudentShow: false,
      isAchStudentExaminationScoreListShow: false,
      isAchStudentSubjectScoreListCompShow: false,
      isAchStudentSubjProjItemScoreListCompShow: false,
      key: 'classId',
      studentsId: ''
    }
  },
  computed: {},
  watch: {
    studentVo: {
      immediate: true,
      handler() {
        Object.assign(this.model,this.studentVo);
        this.studentsId = this.model.id;
        this.checkValueKeyIsShow(this.key)
      }
    }
  },
  created() {

  },
  mounted() {
    this.clearValue();
  },
  methods: {
    onTabChange(value, type) {
      this.key = value
      this.checkValueKeyIsShow(this.key)

    },
    checkValueKeyIsShow(key) {
      this.isRelClassStudentShow = false;
      this.isAchStudentExaminationScoreListShow = false;
      this.isAchStudentSubjectScoreListCompShow = false;
      this.isAchStudentSubjProjItemScoreListCompShow = false;
      if (key == 'classId') {
        this.isRelClassStudentShow = true
      }else if(key == 'AchStudentExaminationScoreId'){
        this.isAchStudentExaminationScoreListShow = true;
      }else if(key == 'AchStudentSubjectScoreId'){
        this.isAchStudentSubjectScoreListCompShow = true;
      }else if(key == 'AchStudentSubjProjItemScoreId'){
        this.isAchStudentSubjProjItemScoreListCompShow = true;
      }
    },
    clearValue(){
      this.model = {};
      this.studentsId = '';
    }
  }
}
</script>
<style>


</style>
